package com.jprocms.module.cms.dal.mysql.channel;

import com.jpro.framework.mybatis.core.mapper.BaseMapperX;
import com.jpro.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jprocms.module.cms.dal.dataobject.channel.ChannelRuleMapDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 栏目规则映射 Mapper
 *
 * @author jprocms
 */
@Mapper
public interface ChannelRuleMapMapper extends BaseMapperX<ChannelRuleMapDO> {


    default void deleteByTargetChannelId(Long targetChannelId) {
        delete(new LambdaQueryWrapperX<ChannelRuleMapDO>()
                .eqIfPresent(ChannelRuleMapDO::getTargetId, targetChannelId)
                .orderByDesc(ChannelRuleMapDO::getId));
    }


}
